package cn.dujc.superkid.adapter;

import android.support.annotation.Nullable;
import android.text.format.DateUtils;
import android.util.TimeUtils;

import java.util.List;

import cn.dujc.core.adapter.BaseAdapter;
import cn.dujc.core.adapter.BaseQuickAdapter;
import cn.dujc.core.adapter.BaseViewHolder;
import cn.dujc.superkid.R;
import cn.dujc.superkid.bean.ConsumptionResult;
import cn.dujc.superkid.utils.DateUtil;

/**
 * Created by Administrator on 2018/10/22 0022.
 */

public class RecordsAdapter extends BaseAdapter<ConsumptionResult.OrderEntity> {
    public RecordsAdapter(int layoutResId, @Nullable List<ConsumptionResult.OrderEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ConsumptionResult.OrderEntity item) {
         helper.setText(R.id.item_record_time, DateUtil.formatData("yyyy-MM-dd HH:mm:ss",Long.parseLong(item.getBuytime())));
         helper.setText(R.id.item_record_price,"价格："+item.getPrice());
         helper.setText(R.id.item_record_start,"起始时间："+DateUtil.formatData("yyyy-MM-dd HH:mm:ss",Long.parseLong(item.getVip_start_time())));
        helper.setText(R.id.item_record_end,"结束时间："+DateUtil.formatData("yyyy-MM-dd HH:mm:ss",Long.parseLong(item.getVip_ent_time())));
    }
}
